/**
 * 定义攻击技能
 */
JSBoot.define("attack", ["rpgConstants"], function() {
	this.id = 0x1;
	this.name = "攻击";
	this.gameContext = null;
	//技能算法
	this.algorithm = function(role, pool) {
		var constants = this.refs.rpgConstants;
		var properties = role.properties;

		for(var obj in pool) {

			//这里可以规定射程，触发条件，此处可以实现群攻还是单体攻击
			var triggerConditions = true;

			if(!triggerConditions) {
				continue;
			}

			//攻击 - 防御 = 减少的血量
			var reduceBlood = role.properties[constants.ATTACK] - pool[obj].properties[constants.DEFENSE];

			pool[obj].properties[constants.HP] -= reduceBlood;
		}
	}
});